The present invention relates to programmable controllers. More particularly, it relates to the input circuit of a programmable controller for making it possible to select the power source voltage of an external input device and to use various external input devices.
In general, a programmable controller is constructed as shown in FIG. 6, having an input unit 1 which accepts the signals of external input devices 2 and 3 (in the figure, the output portions of the external input devices are respectively represented by the electronic switch 2 and contact 3 thereof), a control unit 100 which arithmetically or logically processes the signals accepted by the input unit 1, a sequence program memory 102 which stores therein a sequence program for stipulating the procedures of the logical processes of the control unit 100, and an output unit 103 which transmits the logically processed results of the control unit 100 to external loads 104 on the basis of the contents of the memory 102. The sequence program to be stored in the sequence program memory 102 is set by a programming unit 101 and is transferred to this memory in advance. The control unit 100 constitutes a processor means and executes the sequence program stored in the memory 102.
Numeral 105 denotes an A.C. power source.
An input circuit included in the input unit 1 of such a programmable controller has heretofore been as illustrated in FIG. 7. It is constructed of a power source 9, a limiting resistor 106, a photocoupler 18 which serves to optically transmit the signals for the purpose of isolation, a capacitor 22 and a resistor 21 which reduce noise, and a limiting resistor 20 for the photocoupler 18.
With the above construction, when the voltage specifications of the external input devices 2 and 3 are different, the transfer characteristic of the photocoupler 18 changes. This poses the problem that the resistance of the resistor 106 must be changed, or that the resistor 106 generates heat in proportion to the square of the power source voltage 9 when the resistance of the resistor 106 is held constant. Mentioned as a method of solving this problem is a technique which is disclosed in the official gazette of Japanese Utility Model Registration Application Laid-open No. 46805/1989. According to this technique, an input terminal is furnished with two common terminals, and either of two levels of D.C. input voltage is selected by appropriately using the common terminals.
In addition, the official gazette of Japanese Patent Application Laid-open No. 146305/1984 discloses a technique wherein a current regulator circuit is connected in series with an LED (light emitting diode) disposed on the input side of the photocoupler, whereby current to be fed to the input side LED is held substantially constant for many levels of input signal voltages having different voltage values.
Further, the official gazette of Japanese Patent Application Laid-open No. 237702/1989 discloses a technique wherein the magnitude of a detection reference threshold voltage for an input signal voltage is changed by a voltage control circuit, depending upon the fluctuation of an input voltage level, whereby the input signal voltage is reliably detected in spite of the level fluctuation thereof.
With the known example stated in the official gazette of Japanese Utility Model Registration Application Laid-open No. 46805/1989, the specifications of the input voltages are fixed to two voltage levels, for example, 24 V and 12 V. This has led to the drawback that, when accepting the external signal of a TTL (transistor-transistor logic) circuit (based on 5 V), the resistor 106 shown in FIG. 7 must be altered for the purpose of causing a stipulated current to flow. Moreover, the conventional power source of 24 V must be prepared outside the programmable controller in order to avoid the fixation thereof to one sort of power source. This has been very inconvenient to the users of such programmable controllers.
In addition, according to the prior-art technique in the official gazette of Japanese Patent Application Laid-open No. 146305/1984, the alteration of the resistor 106 is dispensed with. However, when the current regulator circuits as disclosed herein are applied to the respective photocouplers, increase in the number of external input points has incurred the problems of a large packaging area and a high cost.
Besides, in any of the known examples stated above, the direction in which the current of the photocoupler flows is fixed. This has led to the problem that the different specifications of the external input devices, for example, a current absorption type (sink type) and a voltage output type (source type) make it necessary to alter the components of the input circuit or to employ a bidirectional photocoupler, which is expensive.